<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>个人中心</title>
      <link rel="stylesheet" type="text/css" href="../../css/api.css" />
      <link rel="stylesheet" type="text/css" href="../../css/common.css" />
      <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    	<link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
      <style>
          html, body {width: 100%;min-height: 100%;background: #F3EFEE;}
          .aui-active .aui-bar-tab-label{
            color: #f5a51c
          }
          .login {height:240px;background-image: -webkit-linear-gradient(0deg, #f5c674, #ed824c);/*background-image: url(../../image/personal_bkg.jpg);background-repeat: no-repeat; background-size: cover;*/position: relative;}
      	.login .personal_logo {width: 4rem;height: 4rem;border-radius: 50%;margin: 0 auto 9px;/*position: absolute; top: 60px; left: 20px;*/}
      		.login .userinfo {position: absolute; top: 60px;text-align: center; left: 0; right: 0;}
      		.login .userinfo .title {font-size: 0.8rem; color: #fff;}

      		/* 设置条目 */
      		.item {height: 3rem;line-height: 3rem;padding-left: 0.7rem;background-color: #fff;}
      		.item_ico {float: left;width: 2.3rem;padding: 0.7rem 0.7rem 0.7rem 0;}
      		.item_arrow {float: right;width: 1.5rem;padding: 1rem 0.7rem 1rem 0;}
      		.item span {font-size: 0.7rem;}
          [v-cloak] {
              display: none;
          }
          .aui_list{
              background-image: linear-gradient(0,#eee,#eee 50%,transparent 50%);
          }
          .aui-list-item{
              background-image:linear-gradient(0,#eee,#eee 50%,transparent 50%) !important;
          }
         .aui-radio:checked{
            background: #f23030;
            border-color: #f23030;
            width: 0.8rem;
            height: 0.8rem;
            position: relative;
            top: 0.25rem;
            margin-right: 0.5rem;
          }
          .aui-radio{
            position: relative;
            top: 0.25rem;
            margin-right: 0.5rem;
            width: 0.8rem;
            height: 0.8rem;
          }
          .aui-toast-content{
            color: #fff;
          }
      </style>
  </head>
  <body>
<div id="app" v-cloak>

<div class="user_nav_line"></div>
  <div class="aui-refresh-content">
    <ul class="aui-list aui-form-list">
      <li class="aui-list-item">
          <div class="aui-list-item-inner">
              <div class="aui-list-item-label" style="width: 29%;">
                  引荐人员
              </div>
              <div class="aui-list-item-input">
                  <input type="text" placeholder="请填写引荐人" style="font-size: 0.7rem;" v-model="realname">
              </div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-label" style="width: 29%;">
                    联系方式
                </div>
                <div class="aui-list-item-input">
                    <input type="text" placeholder="请填写联系方式" style="font-size: 0.7rem;" v-model="userPhone">
                </div>
              </div>
          </li>
          <li><div class="user_nav_line"></div></li>
          <li class="aui-list-item">
              <div class="aui-list-item-inner">
                  <div class="aui-list-item-label" style="width: 29%;">
                      商家名称
                  </div>
                  <div class="aui-list-item-input">
                      <input type="text" placeholder="请填写商家名称" style="font-size: 0.7rem;" v-model="shopName">
                  </div>
                </div>
          </li>
          <li class="aui-list-item">
              <div class="aui-list-item-inner">
                  <div class="aui-list-item-label" style="width: 29%;">
                      经营范围
                  </div>
                  <div class="aui-list-item-input">
                      <input type="text" placeholder="请填写商家经营范围" style="font-size: 0.7rem;" v-model="shopRange">
                  </div>
                </div>
          </li>
          <li class="aui-list-item">
              <div class="aui-list-item-inner">
                <div class="aui-list-item-label" style="width: 29%;">
                    商家类型
                </div>
                <div class="aui-list-item-input">
                    <label><input class="aui-radio" type="radio" name="demo1" checked @click="choose(0)"> 源头厂家</label>
                    <label style="margin-left: 1.5rem;"><input class="aui-radio" type="radio" name="demo1" @click="choose(1)"> 本地服务</label>
                </div>
              </div>
          </li>
          <li style="background: #F3EFEE;padding-top:1.5rem;padding-bottom:1.5rem;"> <div style="width:79vw;height:2.3rem;color:#fff;text-align:center;line-height:2.3rem;background:#f23030;margin:0 auto;border-radius:1.5rem;" @click="tostSucess()">提交</div></li>
    </ul>
  </div>

<div>
<!--弹框-->

</div>
  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/zepto.js"></script>
  <script type="text/javascript" src="../../script/vue.min.js"></script>
  <script type="text/javascript" src="../../script/utils.js"></script>
  <script type="text/javascript" src="../../script/common.js"></script>
  <script type="text/javascript" src="../../script/aui-tab.js"></script>
  <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  <script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
  <script type="text/javascript" src="../../script/aui-popup.js"></script>
  <script type="text/javascript" src="../../script/aui-dialog.js"></script>
  <script type="text/javascript" src="../../script/aui-toast.js"></script>
  <script type="text/javascript">
      apiready = function(){
        var toast = new auiToast({});
        new Vue({
          el:'#app',
          data:{
            realname:'',
            userPhone:'',
            shopName:'',
            shopRange:'',
            shopType:0
          },
          methods:{
            //刷新
          setRefresh:function() {
                var pullRefresh = new auiPullToRefresh({
                    container: document.querySelector('.aui-refresh-content'),
                    triggerDistance: 100
                }, function(ret) {

                    if (ret.status == "success") {
                        setTimeout(function() {
                            pullRefresh.cancelLoading(); //刷新成功后调用此方法隐藏
                        }, 1500)
                    }
                })
            },
            //提交
            tostSucess:function(){
              var _this = this;
              api.ajax({
                  url: window.Url.Freestore_purchaseStore,
                  method: 'post',
                  data: {
                      values: {
                          token:$api.getStorage('token'),
                          realname:_this.realname,
                          mobile:Base64.encode('UNO' + _this.userPhone + 'HACHA'),
                          name:_this.shopName,
                          range:_this.shopRange,
                          type:_this.shopType
                      }

                  }
              },function(ret, err){
                  if (ret.re==1) {
                      // alert( JSON.stringify( ret ) );
                      toast.success({
                            title:ret.info,
                            duration:1000
                      });
                  } else {
                      toast.fail({
                        title:ret.info,
                        duration:1000
                      })
                  }
              });


            },
            choose:function(type){
              var _this = this;
              _this.shopType = type;
            }
          },
          mounted:function(){
            this.setRefresh();
          },
          updated:function(){}
        })
      };
      var popup = new auiPopup();
         function showPopup(){
             popup.show(document.getElementById("top-right"))
         }


  </script>
  </html>
